/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cobrancalm;

import ConexaoBD.connectionFactory;
import br.com.bb.plugin.interfaces.cbr.DialogErro;
import br.com.bb.plugin.interfaces.cbr.DialogParcelamento;
import br.com.bb.plugin.negocio.comum.Usuario;
import br.com.bb.plugin.persistencia.comum.UsuarioDB;
import exporter.Writter;
import java.io.File;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JFrame;

/**
 *
 * @author user
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws SQLException, Throwable {
        // TODO code application logic here
        System.out.println("Criando conexao com o banco...");
        connectionFactory cf = new connectionFactory("c:\\prgrasso\\comercio.mdb", null, null);
        ResultSet rs = cf.executaSQL("select * from clientes order by nome");
        //while (rs.next()) {
            Writter w=new Writter(new File("C:\\Documents and Settings\\user\\Desktop\\saida.txt"));
            w.write(2, "00"); //Header
            w.write(2, "23"); //Tipo CNPJ
            w.write(14, "612367090000185"); //Tipo CNPJ
            w.write(30,"Serralharia Lopes Martines Ltda"," ");
            w.write(452,"0","0");
            //Acabou Header
            
            //Titulo e Cliente
            w.write(2, "01"); //Tipo - Titulo e Cliente
            w.write(6, "0","0");
            w.write(2,
           

        //}
        rs.close();
        cf.fechaCon();
    }
}
